<template>
  <div class="goods-Material_right">
    <vxe-table
      ref="refList"
      text-algin="center"
      border
      stripe
      resizable
      highlight-hover-row
      :data="list"
      :auto-resize="true"
      :height="380"
      :radio-config="{highlight: true}"
      @radio-change="radioChange"
    >
      <vxe-table-column type="radio" width="50" title="选择" />
      <vxe-table-column field="name" min-width="120" title="视频名称" />
    </vxe-table>
    <vxe-pager
      :current-page.sync="searchParams.pageNum"
      :page-size.sync="searchParams.pageSize"
      :total="total"
      :layouts="['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']"
      @page-change="getMaterialList"
    />
  </div>
</template>
<script>
import { getMaterialList } from '@/api/file/source'
export default {
  data(){
    return {
      searchParams: {
        parentId: '',
        type: 2,
        rule: 1,
        pageNum: 1,
        pageSize: 20
      },
      total:0,
      list:[]
    }
  },
  mounted(){
    this.getMaterialList()
  },
  methods:{
    getMaterialList() {
      getMaterialList(this.searchParams).then(res => {
        this.total = res.total
        this.list = res.records
      })
    },
    radioChange(row){
      this.$emit('videoBox', row.row)
    }
  }
}
</script>